package com.etc.cloud.controller;

import com.etc.cloud.entityes.CommonResult;
import com.etc.cloud.entityes.Payment;
import com.etc.cloud.service.PaymentFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

/**
 * @Author kalista
 * @Description
 * @Date 2020/8/21  15:04
 **/
@RestController
@Slf4j
public class OrderFeignController {



    @Autowired
    private PaymentFeignService paymentFeignService;

    /**
     * 根据id进行查询
     * @param id
     * @return
     */
    @GetMapping("/consumer/payment/get/{id}")
    public CommonResult<Payment> getPaymentById(@PathVariable("id") Long id) {
        CommonResult<Payment> paymentById = paymentFeignService.getPaymentById(id);
        return paymentById;
    }


    @GetMapping("/consumer/payment/feigin/timeout")
    public String paymentFeginFTimeOut(){
        return paymentFeignService.paymentFeginFTimeOut();
    }


}
